#!/usr/bin/env bash

err=0
function _trap_error() {
    local exit_code="$1"
    if [ "$exit_code" -ne 2 ] && [ "$exit_code" -ne 3 ]; then
        (( err |= "$exit_code" ))
    fi
}

trap '_trap_error $?' ERR
trap 'exit $err' SIGINT SIGTERM

lein clj-kondo --lint "$(lein classpath)"

exit "$err"
